import request from '@/utils/request'

/**
 * 获取组织架构列表数据
 * @returns promise
 */
export function getDepartmentsAPI() {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

/**
 * 删除部门
 * @param {*} id 部门id
 * @returns promise
 */
export function delDempByIdAPI(id) {
  return request({
    method: 'DELETE',
    url: '/company/department/' + id
  })
}

/**
 * 新增部门
 * @param {*} data  部门信息
 * @returns  promise
 */
export function addDempAPI(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

/**
 * 编辑部门
 * @param {*} id 部门id
 * @param {*} data
 * @returns promise
 */
export function editDempAPI(data) {
  return request({
    method: 'PUT',
    url: '/company/department/' + data.id,
    data
  })
}
